package com.travel.persitence;

import java.util.List;
import com.travel.model.City;
import com.travel.common.persitence.DaoUtil;
import com.travel.common.util.AbstractBean;

public class CityDao extends AbstractBean {

	private static final long serialVersionUID = 2988228513717287993L;

	public City get(String id) {
		DaoUtil beanDaoUtil = (DaoUtil) this.getBean("beanDaoUtil");
		return (City) beanDaoUtil.get(City.class, id);
	}
	
	public City save(City item) {
		DaoUtil beanDaoUtil = (DaoUtil) this.getBean("beanDaoUtil");
		return (City) beanDaoUtil.saveOrUpdate(item);
	}
	
	@SuppressWarnings("unchecked")
	public List<City> list() {
		DaoUtil beanDaoUtil = (DaoUtil) this.getBean("beanDaoUtil");
		return (List<City>) beanDaoUtil.list("City");
	}
}
